// lua5.3 interpreter
package main

import (
	"bufio"
	"fmt"
	"lua"
	"os"
)

func f() {
	fmt.Println("f() begins()")
	g()
	fmt.Println("f() ends()")
}

func g() {
	defer func() {
		if r := recover(); r != nil {
			fmt.Printf("g:recover() with %v\n", r)
		}
	}()

	fmt.Println("g() begins()")
	panic("g")
}

type header map[string]string

func modify(h header) {
	h["name"] = "rechardchen"
}

const (
	TK_AND = 257 + iota
	TK_BREAK
	TK_DO
)

func main() {
	filename := "test.lua"
	fin, err := os.Open(filename)
	if err == nil {
		reader := bufio.NewReader(fin)
		lexer := lua.NewLexer(reader)
		parser := lua.NewParser(lexer)
		parser.Statlist()
	}
}
